
(async () => {

    const Sequelize = require('sequelize')

    
    // 定义模型
    const Fruit = sequelize.define("Fruit", {
        name: { type: Sequelize.STRING(20), allowNull: false },
        price: { type: Sequelize.FLOAT, allowNull: false }, 
        stock: { type: Sequelize.INTEGER, defaultValue: 0 } 
    });
    
    let ret = await Fruit.sync()

    ret = await Fruit.create({
        name: 'balalar',
        price: 3.5
    })

    console.log('create', ret)

}) ()
